<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script language="javascript" type="text/javascript">
function onCompute()
{
  var obj	= document.getElementById("length");
  var dsp	= document.getElementById("dispLayer");
  dsp.innerHTML = Math.round(obj.value * 2.834645669291);
  return false;
}

function onKeyPress(evt)
{
  if (evt.keyCode == 13 || evt.keyCode == 0) {
    onCompute();
  }
}

</script>
</head>

<body>
<br />
<input type="text" id="length" onfocus="this.select()" onclick="this.select()" onkeyup="javascript:onKeyPress(event)" />
<input type="button" value=" 计 算 " onclick="javascript:onCompute()" /><br /><br />
<div id="dispLayer"></div>
</body>
</html>
